package com.xwb.dao;

import com.xwb.domain.Leader;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface LeaderDao {

    /**
     * values后面要是由pojo的嵌套信息，要用对象名.属性名表示，==>#{tutor.tutorName},#{tutor.tutorInstitute}
     * @param leader
     */
    @Insert("insert into leader(name, id, institute, stu_class,phone, tutor_name, tutor_institute) " +
            "values(#{name},#{id},#{institute},#{stuClass},#{phoneNumber},#{tutor.tutorName},#{tutor.tutorInstitute})")
    public void save(Leader leader);

/**
 * {    JSON表例子：
 *     "name":"陈立农",
 *     "id":"15200",
 *     "institute":"糖果超甜学院",
 *     "stuClass":"ikun1班",
 *     "phoneNumber":15820223576,
 *     "tutor":{
 *         "tutorName":"王方方",
 *         "tutorInstitute":"数字经济学院"
 *     }
 * }
 */


}
